//
//  NRWCarHomeTopCell.m
//  New_Runway
//
//  Created by mack on 2018/1/24.
//  Copyright © 2018年 NelsonJ. All rights reserved.
//

#import "NRWCarHomeTopCell.h"
#import "HomeWebviewLoadingController.h"
#import "DataCensusVC.h"
#import "CarInputVC.h"

@interface NRWCarHomeTopCell ()
@property (weak, nonatomic) IBOutlet UIView *dataView;

@property (weak, nonatomic) IBOutlet NSLayoutConstraint *carinputW;

@property (weak, nonatomic) IBOutlet NSLayoutConstraint *dataW;
@property (weak, nonatomic) IBOutlet UILabel *titleone;
@property (weak, nonatomic) IBOutlet UILabel *titleTwo;
@property (weak, nonatomic) IBOutlet UILabel *titlethree;
@property (weak, nonatomic) IBOutlet UILabel *titlegour;
@end

@implementation NRWCarHomeTopCell

- (void)awakeFromNib {
    [super awakeFromNib];
    self.dataView.layer.masksToBounds = YES;
    self.titleone.textColor = self.titleTwo.textColor = self.titlethree.textColor = self.titlegour.textColor = MAIN_FONT_COLOR();
    self.carinputW.constant  = Screen_width / 4;
    self.dataW.constant = Screen_width / 4;
//    if ([NRWCarUser sharedUser].shopId) {
//        self.carinputW.constant  = Screen_width / 4;
//        self.dataW.constant = Screen_width / 4;
//    }else{
//        
//        self.carinputW.constant  = Screen_width / 3;
//        self.dataW.constant = 0;
//    }
    

}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

}
- (IBAction)weShopLook:(id)sender {
    HomeWebviewLoadingController *shopWebVc = [[HomeWebviewLoadingController alloc] init];
    shopWebVc.mainTitle = @"微店预览";
    
    if ([NRWCarUser sharedUser].shopId) {
        shopWebVc.urlstr = [NSString stringWithFormat:@"%@/mshop/src/home.html?shopId=%@&marketId=%@&imgUrl=%@&os=ios",Api,[NRWCarUser sharedUser].shopId,[NRWCarUser sharedUser].marketId,ImageApi];
        
    }else{
        shopWebVc.urlstr = [NSString stringWithFormat:@"%@/mshop/src/home.html?shopId=%@&marketId=%@&imgUrl=%@&os=ios",Api,@"",[NRWCarUser sharedUser].marketId,ImageApi];
        
    }
    [self.nav pushViewController:shopWebVc animated:YES];
}
- (IBAction)carValuation:(id)sender {
    
    HomeWebviewLoadingController *shopWebVc = [[HomeWebviewLoadingController alloc] init];
    shopWebVc.mainTitle = @"车辆估值";
    shopWebVc.urlstr =@"http://m.che300.com/pinggu";
    [self.nav pushViewController:shopWebVc animated:YES];

}
- (IBAction)oneKeyInputCar:(id)sender {
    CarInputVC *inputVc = [[CarInputVC alloc] init];
    inputVc.isOneKeyPut = YES;
    [self.nav pushViewController:inputVc animated:NO];
}


- (IBAction)datadataStatistics:(id)sender {
    DataCensusVC *dataVC = [[DataCensusVC alloc] init];
    [self.nav pushViewController:dataVC animated:YES];
}
@end
